const redis = require("redis")
const redisConfig = {
  host: "127.0.0.1",
  port: "6379"
}
const redisClient = redis.createClient(redisConfig)

redisClient.on("error", (err) => {
    console.log("client",err)
})
redisClient.set("myname","lei",redis.print)

redisClient.get("myname",(err,reply)=> {
  if(err){
    console.error("get err",reply);

  }
  console.log(reply);

}
)

redisClient.quit()

